package com.tianji.learning.controller;


import com.tianji.common.domain.dto.PageDTO;
import com.tianji.learning.domain.dto.ReplyDTO;
import com.tianji.learning.domain.query.ReplyPageQuery;
import com.tianji.learning.domain.vo.ReplyVO;
import com.tianji.learning.service.IInteractionReplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 互动问题的回答或评论 前端控制器
 * </p>
 *
 * @author EllieHy
 * @since 2024-06-01
 */
@RestController
@RequiredArgsConstructor
@Slf4j
@Api("互动问题的回答或评论")
@RequestMapping("/replies")
public class InteractionReplyController {
	private final IInteractionReplyService interactionReplyService;
	
	@ApiOperation("新增互动问题的回答或评论")
	@PostMapping
	public void saveReply(@RequestBody @Validated ReplyDTO dto) {
		interactionReplyService.saveReply(dto);
	}
	@ApiOperation("分页查询回答或评论")
	@GetMapping("page")
	public PageDTO<ReplyVO> queryReplyPage(ReplyPageQuery pageQuery){
		return interactionReplyService.queryReplyPage(pageQuery, false);
	}
	
	
}
